package IoCz;

import Book.Book;
import Book.BookList;

import java.util.Scanner;

public class IoFind implements IoCz{
    @Override
    public void ioCz(BookList bookList) {
        System.out.println("====查找图书====");
        System.out.println("请输入需要查找书籍的名字");
        String name = scanner.nextLine();
        for (int i = 0; i < bookList.booksize; i++) {
             Book book = bookList.books[i];
             if(name.equals(book.getName())){
                 System.out.println("====找到了，信息如下====");
                 System.out.println(book);
                 return;
             }
        }
        System.out.println("没有此书");
    }
}
